package com.xxx.car.mapper;

import com.xxx.car.entity.TbUserCar;
import com.xxx.car.entity.vo.request.ReqUserCarAdminQuery;
import com.xxx.car.entity.vo.request.ReqUserCarQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TbUserCarMapper {
    int deleteByPrimaryKey(Integer carId);

    int insert(TbUserCar record);

    int insertSelective(TbUserCar record);

    TbUserCar selectByPrimaryKey(Integer carId);

    int updateByPrimaryKeySelective(TbUserCar record);

    int updateByPrimaryKey(TbUserCar record);

    TbUserCar getByIdAndUserId(@Param("carId") Integer carId, @Param("userId") Integer userId);

    void deleteByIdAndUserId(@Param("carId") Integer carId, @Param("userId") Integer userId);

    List<TbUserCar> query(ReqUserCarQuery query);

    List<TbUserCar> queryForAdmin(ReqUserCarAdminQuery query);

    List<Map<String, Object>> statusGroupCount();

    List<TbUserCar> getUserDefaultCar(Integer userId);

    int clearDefaultByUserId(@Param("userId") Integer userId);

    int setUserDefaultCar(@Param("userId") Integer userId, @Param("carId") Integer carId);

    TbUserCar getCarByCarNo(@Param("carNo") String carNo);
}